package com.book.helper;

import com.book.dto.UserDto;
import com.book.pojo.User;
import org.springframework.beans.BeanUtils;

/**
 * @Author 李锦程
 * @Date 2021/4/4 5:59 下午
 * @Package com.book.helper
 * @Version 1.0
 */
public class UserHelper {
    public static User convertDtoToPo(UserDto user) {
        User user1 = new User();
        if (user!=null){
            BeanUtils.copyProperties(user,user1);
        }
        return user1;
    }

    public static UserDto convertPoToDto(User user) {
        UserDto user1 = new UserDto();
        if (user!=null){
            BeanUtils.copyProperties(user,user1);
        }
        return user1;
    }
}
